package com.iking.toolkit.formatdeal.controller;

import com.iking.toolkit.formatdeal.async.FileFormatAsync;
import com.iking.toolkit.formatdeal.enums.FileFormatPathEnum;
import com.iking.toolkit.formatdeal.model.FileFormatConversion;
import com.iking.toolkit.formatdeal.service.FileFormatConversionService;
import com.iking.toolkit.model.Msg;
import com.iking.toolkit.formatdeal.model.dto.FileUrlDTO;
import com.iking.toolkit.formatdeal.service.TextService;
import com.iking.toolkit.util.FileFormatUtil;
import com.iking.toolkit.util.SysUtil;
import com.iking.toolkit.util.minio.MinioStorage;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;

/**
 * 功能描述:Text文件格式转换
 *
 * @author: yfl
 * @date: 2025/8/4 14:36
 */
@Slf4j
@Tag(name = "TextController", description = "Text文件格式转换管理")
@RequestMapping("/text")
@RestController
@Validated
public class TextController {

    @Autowired
    private TextService textService;

    @Autowired
    private FileFormatConversionService fileFormatConversionService;


    @Operation(summary = "Text转Docx,文件url")
    @PostMapping("/textToDocx")
    public Msg textToDocx(@RequestBody @Valid FileUrlDTO fileUrlDTO, HttpServletResponse response) {
        return textService.textToDocx(fileUrlDTO, response);
    }

}
